namespace ContactSMS.Client.Views.Controls;

public partial class IconFontLabel : ContentView
{
    public static readonly BindableProperty TextProperty =
            BindableProperty.Create(nameof(Text), typeof(string), typeof(IconFontLabel), default(string), propertyChanged: OnTextChanged);

    public string Text
    {
        get => (string)GetValue(TextProperty);
        set => SetValue(TextProperty, value);
    }

    public IconFontLabel()
    {
        InitializeComponent();
    }

    private static void OnTextChanged(BindableObject bindable, object oldValue, object newValue)
    {
        var control = (IconFontLabel)bindable;
        control.iconLabel.Text = (string)newValue;
    }
}